/* 
 * File:   Hitbox.h
 * Author: artem
 *
 * Created on November 17, 2011, 9:36 PM
 */

#ifndef HITBOX_H
#define HITBOX_H

struct Hitbox
{
	float x, y, w, h;
	
	Hitbox() {}
	Hitbox(float x, float y, float w, float h): x(x), y(y), w(w), h(h) {}
	
	bool isIntersect(const Hitbox &hitbox) const
	{
		return !((x + w) < hitbox.x || (y + h) < hitbox.y ||
			x > (hitbox.x + hitbox.w) || y > (hitbox.y + hitbox.h));
	}
};

#endif /* HITBOX_H */
